class Dorp2 {
	constructor(box1, doc, box2) {
		this.box1 = document.querySelector(box1);
		this.box2 = document.querySelector(box2);
		this.doc = doc;
	}
	show2() {
		var oDiv = this.box1;
		var doc = this.doc;
		var oDiv1 = this.box2;
		this.box2.onmousedown = function(ev) {
			//              console.log(this)
			var ev = ev || ev.event;
			var x = ev.clientX - this.offsetLeft;
			this.className = "box2";
			//              console.log(x)
			var y = ev.clientY - this.offsetTop;
			doc.onmousemove = function(ev) {
				var ev1 = ev || ev.event;
				oDiv1.style.left = ev1.clientX - x + "px";
				oDiv1.style.top = ev1.clientY - y + "px";
			}
			doc.onmouseup = function() {
				//                  console.log(oDiv1.offsetLeft);
				oDiv1.className = "";
				oDiv.style.left = oDiv1.offsetLeft + "px";
				oDiv.style.top = oDiv1.offsetTop + "px";
				document.onmousemove = null;
			}
			return false;
		}
	}
}

export default Dorp2;